<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libschc: compressor.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libschc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">compressor.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="compressor_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* (c) 2018 - idlab - UGent - imec</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Bart Moons</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * This file is part of the SCHC stack implementation</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifndef __SCHCCOMPRESSOR_H__</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#define __SCHCCOMPRESSOR_H__</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="bit__operations_8h.html">bit_operations.h</a>&quot;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="schc_8h.html">schc.h</a>&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;int8_t <a class="code" href="compressor_8h.html#a15002a02e9cae01e5629cb2d474fe482">set_rule_id</a>(<span class="keyword">struct</span> <a class="code" href="structschc__rule__t.html">schc_rule_t</a>* schc_rule, uint8_t* data);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;uint8_t <a class="code" href="compressor_8h.html#a4fd03f3acd56b4bf55fc4c8e48567ab7">schc_compressor_init</a>(uint8_t src[16]);</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;int16_t <a class="code" href="compressor_8h.html#a0b9e16aa71f4074dec7245991fdebcdb">schc_compress</a>(uint8_t *data, uint16_t total_length,</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        <a class="code" href="structschc__bitarray__t.html">schc_bitarray_t</a>* buf, uint32_t device_id, <a class="code" href="schc_8h.html#a99f26e6ee9fcd62f75203b5402df8098">direction</a> dir,</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        <span class="keyword">struct</span> <a class="code" href="structschc__rule__t.html">schc_rule_t</a> **schc_rule);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">struct </span><a class="code" href="structschc__rule__t.html">schc_rule_t</a>* <a class="code" href="compressor_8h.html#aaf76c0525a94eecb1f694ba09b435c49">get_schc_rule_by_reliability_mode</a>(</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;        <span class="keyword">struct</span> <a class="code" href="structschc__rule__t.html">schc_rule_t</a>* schc_rule, <a class="code" href="schc_8h.html#a00b61f9b90ab7065eb6a978141d7fd34">reliability_mode</a> <a class="code" href="structschc__rule__t.html#ac7514a12feafa1bdff35354fa8df76a8">mode</a>,</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        uint32_t device_id);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="keyword">struct </span><a class="code" href="structschc__rule__t.html">schc_rule_t</a>* <a class="code" href="compressor_8h.html#aad3e564426f2baa62e653ebdb5635e2e">get_schc_rule_by_rule_id</a>(uint8_t* rule_id,</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        uint32_t device_id);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;uint16_t <a class="code" href="compressor_8h.html#a8af6027989d3e39cdcc37f16ff38d7ff">schc_decompress</a>(<a class="code" href="structschc__bitarray__t.html">schc_bitarray_t</a>* bit_arr, uint8_t *buf,</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        uint32_t device_id, uint16_t total_length, <a class="code" href="schc_8h.html#a99f26e6ee9fcd62f75203b5402df8098">direction</a> dir);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;}</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="astructschc__bitarray__t_html"><div class="ttname"><a href="structschc__bitarray__t.html">schc_bitarray_t</a></div><div class="ttdef"><b>Definition:</b> schc.h:32</div></div>
<div class="ttc" id="acompressor_8h_html_aaf76c0525a94eecb1f694ba09b435c49"><div class="ttname"><a href="compressor_8h.html#aaf76c0525a94eecb1f694ba09b435c49">get_schc_rule_by_reliability_mode</a></div><div class="ttdeci">struct schc_rule_t * get_schc_rule_by_reliability_mode(struct schc_rule_t *schc_rule, reliability_mode mode, uint32_t device_id)</div><div class="ttdef"><b>Definition:</b> compressor.c:101</div></div>
<div class="ttc" id="aschc_8h_html_a00b61f9b90ab7065eb6a978141d7fd34"><div class="ttname"><a href="schc_8h.html#a00b61f9b90ab7065eb6a978141d7fd34">reliability_mode</a></div><div class="ttdeci">reliability_mode</div><div class="ttdef"><b>Definition:</b> schc.h:58</div></div>
<div class="ttc" id="acompressor_8h_html_a8af6027989d3e39cdcc37f16ff38d7ff"><div class="ttname"><a href="compressor_8h.html#a8af6027989d3e39cdcc37f16ff38d7ff">schc_decompress</a></div><div class="ttdeci">uint16_t schc_decompress(schc_bitarray_t *bit_arr, uint8_t *buf, uint32_t device_id, uint16_t total_length, direction dir)</div><div class="ttdoc">Construct the header from the layered set of rules.</div><div class="ttdef"><b>Definition:</b> compressor.c:1075</div></div>
<div class="ttc" id="astructschc__rule__t_html"><div class="ttname"><a href="structschc__rule__t.html">schc_rule_t</a></div><div class="ttdef"><b>Definition:</b> schc.h:128</div></div>
<div class="ttc" id="aschc_8h_html"><div class="ttname"><a href="schc_8h.html">schc.h</a></div></div>
<div class="ttc" id="aschc_8h_html_a99f26e6ee9fcd62f75203b5402df8098"><div class="ttname"><a href="schc_8h.html#a99f26e6ee9fcd62f75203b5402df8098">direction</a></div><div class="ttdeci">direction</div><div class="ttdef"><b>Definition:</b> schc.h:37</div></div>
<div class="ttc" id="acompressor_8h_html_a4fd03f3acd56b4bf55fc4c8e48567ab7"><div class="ttname"><a href="compressor_8h.html#a4fd03f3acd56b4bf55fc4c8e48567ab7">schc_compressor_init</a></div><div class="ttdeci">uint8_t schc_compressor_init(uint8_t src[16])</div><div class="ttdoc">Initializes the SCHC compressor.</div><div class="ttdef"><b>Definition:</b> compressor.c:823</div></div>
<div class="ttc" id="acompressor_8h_html_aad3e564426f2baa62e653ebdb5635e2e"><div class="ttname"><a href="compressor_8h.html#aad3e564426f2baa62e653ebdb5635e2e">get_schc_rule_by_rule_id</a></div><div class="ttdeci">struct schc_rule_t * get_schc_rule_by_rule_id(uint8_t *rule_id, uint32_t device_id)</div><div class="ttdef"><b>Definition:</b> compressor.c:186</div></div>
<div class="ttc" id="abit__operations_8h_html"><div class="ttname"><a href="bit__operations_8h.html">bit_operations.h</a></div></div>
<div class="ttc" id="acompressor_8h_html_a0b9e16aa71f4074dec7245991fdebcdb"><div class="ttname"><a href="compressor_8h.html#a0b9e16aa71f4074dec7245991fdebcdb">schc_compress</a></div><div class="ttdeci">int16_t schc_compress(uint8_t *data, uint16_t total_length, schc_bitarray_t *buf, uint32_t device_id, direction dir, struct schc_rule_t **schc_rule)</div><div class="ttdoc">Compresses a CoAP/UDP/IP packet.</div><div class="ttdef"><b>Definition:</b> compressor.c:850</div></div>
<div class="ttc" id="astructschc__rule__t_html_ac7514a12feafa1bdff35354fa8df76a8"><div class="ttname"><a href="structschc__rule__t.html#ac7514a12feafa1bdff35354fa8df76a8">schc_rule_t::mode</a></div><div class="ttdeci">reliability_mode mode</div><div class="ttdef"><b>Definition:</b> schc.h:134</div></div>
<div class="ttc" id="acompressor_8h_html_a15002a02e9cae01e5629cb2d474fe482"><div class="ttname"><a href="compressor_8h.html#a15002a02e9cae01e5629cb2d474fe482">set_rule_id</a></div><div class="ttdeci">int8_t set_rule_id(struct schc_rule_t *schc_rule, uint8_t *data)</div><div class="ttdef"><b>Definition:</b> compressor.c:76</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
